


from menu import *
from trade import *
from record import *
from visualize import *

# 实例化
strategy=strategy()
visualize=visualize()
menu=menu()
name='贵州茅台'
start_date='2012-10-10'
end_date='2019-10-10'
list=stock.stock_code(name)
stock_name=list[0]
code=list[1]
data_df=stock.get_a_stock(code,start_date,end_date)
print(data_df)
data_df.to_csv("./{}.csv".format(code), index=True)        # 将data_df保存到本地CSV文件
print('数据已经保存到当前目录下%s.csv文件下'%code)
code=pkl.code_rev(code)
stock_dat = visualize.get_data(code, start=start_date, end=end_date)
visualize.show_detail(stock_dat.copy(deep=True), stock_name)